package com.lhm;

public class aaa {
    //饿汉式
    private  static aaa instance;
 //   private static aaa  instance = new aaa();
    private aaa(){}

    public static aaa getInstance() {
        if (instance ==null){
            instance = new aaa();
        }
        return instance;
    }

    public void  show(){
        System.out.println("你好");
    }


    public static void main(String[] args) {
        aaa object = aaa.getInstance();
        object.show();
    }
}


